﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Windvoice.Blog.Model
{
    public class ArticleInfo
    {
        private int _ID;
        private int _CategoryID;
        private int _Hits;
        private int _TrackBacks;

        private string _Author;
        private string _Title;
        private string _Content;
        private string _Weather;
        private string _IP;
        private string _KeyWords;

        private DateTime _PublishTime;
        private bool _IsHidden;

        public ArticleInfo()
        {
        }

        public ArticleInfo(DataRow row)
        {
            _ID=int.Parse(row["id"].ToString());
            _CategoryID = int.Parse(row["categoryid"].ToString());
            _Hits = int.Parse(row["hits"].ToString());
            _TrackBacks = int.Parse(row["trackbacks"].ToString());

            _Author=row["author"].ToString();
            _Title = row["title"].ToString();
            _Content = row["content"].ToString();
            _Weather = row["weather"].ToString();
            _IP = row["ip"].ToString();
            _KeyWords = row["keywords"].ToString();

            _PublishTime = DateTime.Parse(row["publishtime"].ToString());
            _IsHidden = bool.Parse(row["ishidden"].ToString());
        }

        public int ID 
        {
            get { return _ID; }
            set { _ID = value; }
        }
        public int CategoryID
        {
            get { return _CategoryID; }
            set { _CategoryID = value; }
        }
        public int Hits
        {
            get { return _Hits; }
            set { _Hits = value; }
        }
        public int TrackBacks
        {
            get { return _TrackBacks; }
            set { _TrackBacks = value; }
        }

        public string Author
        {
            get { return _Author; }
            set { _Author = value; }
        }
        public string Title
        {
            get { return _Title; }
            set { _Title = value; }
        }
        public string Content
        {
            get { return _Content; }
            set { _Content = value; }
        }
        public string Weather
        {
            get { return _Weather; }
            set { _Weather = value; }
        }
        public string IP
        {
            get { return _IP; }
            set { _IP = value; }
        }
        public string KeyWords
        {
            get { return _KeyWords; }
            set { _KeyWords = value; }
        }

        public DateTime PublishTime
        {
            get { return _PublishTime; }
            set { _PublishTime = value; }
        }
        public bool IsHidden
        {
            get { return _IsHidden; }
            set { _IsHidden = value; }
        }
    }
}
